import java.util.ArrayList;
import java.util.HashMap;
import java.util.Scanner;


public class ApplyGravity implements ApplyForce{
    
   
  
    private double degree=0 ;
    private double magnitude=1 ;
    private double preMagnitude=1;
    
    
    
   
    public Force getForce(Mass m){
        return new Force(degree,magnitude);
    }
    
    public void turnOffForce(){
       
        magnitude=0;
    }
    
    public void turnOnForce(){
        
        magnitude=preMagnitude;
    }
  
    @Override
   public final void build(Scanner line, Simulation sim) {
    
    degree = line.nextDouble();
    magnitude = line.nextDouble();
    preMagnitude=magnitude;
    
    }

    @Override
    public void toggle () {
        if ( magnitude==0){
            turnOnForce();
        }else{
            turnOffForce();
        }
        
    }
    

}
